package com.wenlin.myproduction.ui;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.wenlin.myproduction.R;
import com.wenlin.myproduction.base.BaseActivity;
import com.wenlin.myproduction.base.BaseSwipeActivity;
import com.wenlin.myproduction.util.ValCommon;
import com.wenlin.myproduction.widget.MarqueeView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class MarqueeViewActivity extends BaseSwipeActivity {
    @BindView(R.id.mv)
    MarqueeView mv;

    @Override
    public int getContentView() {
        return R.layout.activity_marquee_view;
    }

    public static void start(BaseActivity activity) {
        Intent intent = new Intent(activity, MarqueeViewActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setTitle(ValCommon.MARQUEE_VIEW);
        setData();
    }

    private void setData() {
        List<MarqueeView.MarqueeBean> list = new ArrayList<>();
        String[] names = {"小晨", "@空里流霜不觉飞@", "若若", "超人不会飞", "倒带"};
        String[] gifts = {"小创客4件套", "定制玩偶", "6888金币", "马克笔套装", "乐高模型积木"};
        String[] heads = {"http://resimg.iqeq.cn/myenglish/res/2020/9/21/YmifCcZ5pDipx6a8Eb37kmkCH2Rir7ct.jpg", "http://resimg.iqeq.cn/webapires/user/images/2020/09/02/24173cdf4988430db7110fd64586985a.jpg", "http://resimg.iqeq.cn/webapires/user/images/2020/10/14/7cab2829151e4405a9a7f1042ec2bca2.jpg", "http://resimg.iqeq.cn/webapires/user/images/2020/10/16/c17e1b6a60574c979931ccad738357dd.jpg", "http://resimg.iqeq.cn/webapires/user/images/2020/10/30/8121d5555bd34f8a8ccf274431dab42b.jpg"};
        for (int i = 0; i < names.length; i++) {
            MarqueeView.MarqueeBean mb = new MarqueeView.MarqueeBean(names[i], gifts[i], heads[i]);
            list.add(mb);
        }
        mv.setData(list);
    }
}
